﻿using System;
using System.Collections.Generic;

namespace Ast.Core.Pe
{
    public class ImportedModule
    {
        public ImportedModule(string moduleName, int timeDateStamp, bool isDelayLoaded)
        {
            if (moduleName == null) throw new ArgumentNullException("moduleName");
            ModuleName = moduleName;
            TimeDateStamp = timeDateStamp;
            IsDelayLoaded = isDelayLoaded;

            Functions = new List<ImportedFunction>();
        }

        public string ModuleName { get; private set; }

        public int TimeDateStamp { get; private set; }

        public IList<ImportedFunction> Functions { get; private set; }

        public bool IsDelayLoaded { get; private set; }

        public override string ToString()
        {
            return string.Format("{0}({1}){2}", ModuleName, Functions.Count, IsDelayLoaded ? "(deplayed)" : "");
        }
    }
}